<template>
  <nav>
<!--    <router-link to="/">Home</router-link> |-->
<!--    <router-link to="/about">About</router-link>-->
  </nav>
  <router-view/>
<!--  <h2>App页面</h2>-->




</template>
<script>
import global from "@/views/global/global";
export default {
  name: 'App',
  created() {
    //在页面加载时读取sessionStorage里的状态信息
    if (sessionStorage.getItem("user")) {
      global.user = JSON.parse(sessionStorage.getItem("user"));
    }
    //在页面刷新时将vuex里的信息保存到sessionStorage里
    window.addEventListener("beforeunload", () => {
      sessionStorage.setItem("user", JSON.stringify(global.user));
    });
  },
}

</script>

<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
//返回首页，以及小标题
.titleBox{
  border-bottom: darkgray 1px solid;
  line-height: 40px;
  font-weight: bold;
  margin-bottom: 10px;
}

</style>
